from selenium.webdriver.common.by import By
from Base.Base import Base

class Page(Base):
    #进入frame框架
    frame1=(By.XPATH,'/html/body/div[3]/div[3]/div[1]/div/div[3]/div[1]/div[2]/iframe')
    #输入账号
    username=(By.NAME,'email')
    #输入密码
    password=(By.NAME,'password')
    #点击登录按钮
    sbuit=(By.ID,'dologin')

    #定位写信
    xiexin=(By.XPATH,'/html/body/div[1]/nav/div[1]/ul/li[2]/span[2]')

    # #收件人
    # shoujiren=(By.ID,'//div[start-with([@id,"_mail_emailcontainer_0_"])]')
    # #主题
    # zhut=(By.XPATH,'/html/body/div[2]/div[1]/div[2]/div[1]/section/header/div[2]/div[1]/div/div/input')
    #
    # #退出frame1框架
    # #进入frame框架
    # frame2=(By.XPATH,'/html/body/div[2]/div[1]/div[2]/div[1]/section/section/div/div[1]/div[1]/div[2]/iframe')
    #
    # #内容
    # book=(By.CSS_SELECTOR,'nui-scroll')
    #
    # # 退出frame框架
    #
    # #发送
    # fsong=(By.CLASS_NAME,'.nui-btn-text')


    def login(self):
        #进入frame框架
        self.frame(self.frame1)
        #输入账号
        self.send_keys(self.username,'18696472858')
        #输入密码
        self.send_keys(self.password,'woxhniljl520W')
        #点击登录按钮
        self.click(self.sbuit)
        self.default_content()
        #写信
        self.click(self.xiexin)
        # #收件人
        # self.send_keys(self.shoujiren,'1006142636@qq.com')
        # #主题
        # self.send_keys(self.zhut,'你好')
        # #退出frame框架
        # # self.default_content()
        # #进入frame框架
        # self.frame(self.frame2)
        # #内容参数过长
        # self.send_keys(self.book,'你好你好111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111')
        # #退出frame框架
        # self.default_content()
        # #发送
        # self.click(self.fsong)